<?php

$this->_toolbar = array(
	'title'		=>	Yii::t('admin_ads', 'Clients Manager'),
	'buttons'	=>	array(
			CHtml::link(Yii::t('app','Delete'), "", array("id"=>"delete", "class"=>"button-s del", "onclick"=>"CoreJs.deleteAll('".Yii::app()->createUrl('/admin_ads/adsClients/delMulti')."','".Yii::t('app','Are you sure you want to delete item?')."')")),
			CHtml::link(Yii::t('app','Advanced Search'), "",array("id"=>"search", "class"=>"search-button button-s")),
		)
);
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('news-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<div class="search-form">
<?php $this->renderPartial('_search', array(
	'model' => $model,
)); ?>
</div><!-- search-form -->
<?php 
	Yii::app()->clientScript->registerScript('tooltip1', "jQuery('a.actived_toggle').tooltip();");
	Yii::app()->clientScript->registerScript('tooltip2', "jQuery('.button-column a').tooltip();");
?>
<?php $this->widget('ext.widgets.iGridView', array(
	'id' => 'ads-clients-grid',
	'dataProvider' => $model->search(),
	'afterAjaxUpdate'=>'function(){jQuery(".button-column a").tooltip();jQuery("a.actived_toggle").tooltip();}',
	'columns' => array(
		array(
			'type'	=>	'raw',
			'header'	=>'<div id="sl-row" onclick="CoreJs.checkAll(this.id);" status="1"><input type="checkbox" class="checkall" value="" /></div>',
			'htmlOptions'	=>	array(
				'width'	=>	'50',
				'align'	=>	'center',
			),
			'value'	=>	'CHtml::checkBox("rad_ID[]", "", array("value"=>$data->id))'
		),
		'name',
		'contact',
		'email',
		array(
            'class'=>'JToggleColumn',
            'name'=>'actived', // boolean model attribute (tinyint(1) with values 0 or 1)
            'htmlOptions'=>array('style'=>'text-align:center;min-width:60px;'),
        ),
		array(
			'class' => 'CButtonColumn',
		),
		array(
			'name'=>'id',
			'htmlOptions'=>array('style'=>'width: 50px;text-align: center')
		)
	),
)); ?>